package com.qianfeng.exam.dto;


import com.fasterxml.jackson.annotation.JsonIgnore;
import com.github.pagehelper.util.StringUtil;
import com.qianfeng.exam.pojo.Authors;
import com.qianfeng.exam.pojo.Categories;


public class BooksDto {

  private Long bookid;
  private String bookName;
  private Long categoryId;
  private Long bookstatus = 0L;
  private Long authorId;
  private String bookDescription;
  private String bookPicUrl;
  private Categories category;
  private Authors author;

  public Categories getCategory() {
    return category;
  }

  public void setCategory(Categories category) {
    this.category = category;
  }

  public Authors getAuthor() {
    return author;
  }

  public void setAuthor(Authors author) {
    this.author = author;
  }

  @JsonIgnore
  public boolean isNull(){
    return StringUtil.isEmpty(bookName)||authorId==null||categoryId==null;

  }

  @Override
  public String toString() {
    return "BooksDto{" +
            "bookid=" + bookid +
            ", bookName='" + bookName + '\'' +
            ", categoryId=" + categoryId +
            ", bookstatus=" + bookstatus +
            ", authorId=" + authorId +
            ", bookDescription='" + bookDescription + '\'' +
            ", bookPicUrl='" + bookPicUrl + '\'' +
            ", category=" + category +
            ", author=" + author +
            '}';
  }

  public Long getBookid() {
    return bookid;
  }

  public void setBookid(Long bookid) {
    this.bookid = bookid;
  }

  public String getBookName() {
    return bookName;
  }

  public void setBookName(String bookName) {
    this.bookName = bookName;
  }

  public Long getCategoryId() {
    return categoryId;
  }

  public void setCategoryId(Long categoryId) {
    this.categoryId = categoryId;
  }

  public Long getBookstatus() {
    return bookstatus;
  }

  public void setBookstatus(Long bookstatus) {
    this.bookstatus = bookstatus;
  }

  public Long getAuthorId() {
    return authorId;
  }

  public void setAuthorId(Long authorId) {
    this.authorId = authorId;
  }

  public String getBookDescription() {
    return bookDescription;
  }

  public void setBookDescription(String bookDescription) {
    this.bookDescription = bookDescription;
  }

  public String getBookPicUrl() {
    return bookPicUrl;
  }

  public void setBookPicUrl(String bookPicUrl) {
    this.bookPicUrl = bookPicUrl;
  }
}
